﻿<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>云监控</title>
<meta name="keywords"
	content="Bootstrap模版,Bootstrap模版下载,Bootstrap教程,Bootstrap中文" />
<meta name="description"
	content="站长素材提供Bootstrap模版,Bootstrap教程,Bootstrap中文翻译等相关Bootstrap插件下载" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- basic styles -->
<link href="/static/css/bootstrap.min.css" rel="stylesheet" />
<link rel="stylesheet" href="/static/css/font-awesome.min.css" />

<!--[if IE 7]>
		  <link rel="stylesheet" href="/static/css/font-awesome-ie7.min.css" />
		<![endif]-->

<!-- page specific plugin styles -->

<!-- fonts -->

<link rel="stylesheet"
	href="http://fonts.googleapis.com/css?family=Open+Sans:400,300" />

<!-- ace styles -->

<link rel="stylesheet" href="/static/css/ace.min.css" />
<link rel="stylesheet" href="/static/css/ace-rtl.min.css" />
<link rel="stylesheet" href="/static/css/ace-skins.min.css" />

<!--[if lte IE 8]>
		  <link rel="stylesheet" href="/static/css/ace-ie.min.css" />
		<![endif]-->

<!-- inline styles related to this page -->

<!-- ace settings handler -->

<script src="/static/js/ace-extra.min.js"></script>

<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->

<!--[if lt IE 9]>
		<script src="/static/js/html5shiv.js"></script>
		<script src="/static/js/respond.min.js"></script>
		<![endif]-->
</head>

<body>
	<div class="navbar navbar-default" id="navbar">
		<script type="text/javascript">
			try {
				ace.settings.check('navbar', 'fixed')
			} catch (e) {
			}
		</script>

		<div class="navbar-container" id="navbar-container">
			<div class="navbar-header pull-left">
				<a href="#" class="navbar-brand"> <small> <i
						class="icon-leaf"></i> 云监控
				</small>
				</a>
				<!-- /.brand -->
			</div>
			<!-- /.navbar-header -->

			<div class="navbar-header pull-right" role="navigation">
				<ul class="nav ace-nav">






					<li class="light-blue"><a data-toggle="dropdown" href="#"
						class="dropdown-toggle"> <span class="user-info"> <small>你好,</small>
								Jason
						</span> <i class="icon-caret-down"></i>
					</a>

						<ul
							class="user-menu pull-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close">
							<li><a href="#"> <i class="icon-cog"></i> 设置
							</a></li>

							<li><a href="#"> <i class="icon-user"></i> 个人资料
							</a></li>

							<li class="divider"></li>

							<li><a href="#"> <i class="icon-off"></i> 退出
							</a></li>
						</ul></li>
				</ul>
				<!-- /.ace-nav -->
			</div>
			<!-- /.navbar-header -->
		</div>
		<!-- /.container -->
	</div>

	<div class="main-container" id="main-container">
		<script type="text/javascript">
			try {
				ace.settings.check('main-container', 'fixed')
			} catch (e) {
			}
		</script>

		<div class="main-container-inner">
			<a class="menu-toggler" id="menu-toggler" href="#"> <span
				class="menu-text"></span>
			</a>

			<div class="sidebar" id="sidebar">
				<script type="text/javascript">
					try {
						ace.settings.check('sidebar', 'fixed')
					} catch (e) {
					}
				</script>

				{% include "report_navlist.html" %}

				<div class="sidebar-collapse" id="sidebar-collapse">
					<i class="icon-double-angle-left"
						data-icon1="icon-double-angle-left"
						data-icon2="icon-double-angle-right"></i>
				</div>

				<script type="text/javascript">
					try {
						ace.settings.check('sidebar', 'collapsed')
					} catch (e) {
					}
				</script>
			</div>

			<div class="main-content">


				<div class="page-content">


					<div class="row">

						<div class="col-xs-12">
							<!-- PAGE CONTENT BEGINS -->
							<div class="alert alert-info">
								<i class="icon-hand-right"></i> 项目信息
							</div>
							<div class="form-horizontal" id="policy-form"
								style="display: block;">
								<div class="form-group">
									<label class="col-sm-2 control-label"> <span
										class="require_text">*</span> 项目名称：
									</label>
									<div class="col-sm-7">
										<input type="text" id="name"  readonly="true" 
											class="form-control ng-pristine ng-untouched ng-invalid ng-invalid-required">
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label"> <span
										class="require_text">*</span> 域名：
									</label>
									<div class="col-sm-7">
										<input type="text" id="domain"  readonly="true" 
											class="form-control ng-pristine ng-untouched ng-invalid ng-invalid-required"
											>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label"> <span
										class="require_text">*</span> 端口号：
									</label>
									<div class="col-sm-7">
										<span class="block input-icon input-icon-right"> <input  readonly="true" 
											id="port" value="433"
											class="form-control ng-pristine ng-untouched ng-invalid ng-invalid-required"
											ng-model="appidInfo.appname_zh" placeholder="">
										</span>
									</div>
								</div>

								<div class="form-group">
									<label class="col-sm-2 control-label"> <span
										class="require_text">*</span> 检测频率:
									</label>
									<div class="col-sm-7"> 
											<input readonly="true" type="text" id="frequency"
											class="form-control ng-pristine ng-untouched ng-invalid ng-invalid-required">
									</div>


								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label"> <span
										class="require_text">*</span>通知规则:
									</label>
									<div class="col-sm-7">  
										<input readonly="true" type="text" id="notify_name"
											class="form-control ng-pristine ng-untouched ng-invalid ng-invalid-required">
									</div>
								</div>
								
								<div class="form-group">
									<label class="col-sm-2 control-label"> <span
										class="require_text">*</span>扩展检测:
									</label>
									 
                                    <div class="col-sm-7">
										<label> <input  disabled="disabled"  id="ccs" value="ccs"
											type="checkbox" class="ace"> <span class="lbl">
												CCS检测</span>
										</label> 
									 

										<label> <input disabled="disabled" id="hsts" value="hsts"
											type="checkbox" class="ace"> <span class="lbl">
												HSTS检测</span>
										</label>  

										<label> <input disabled="disabled" id="heartbleed" value="heartbleed"
											type="checkbox" class="ace"> <span class="lbl">
												HeartBleed检测</span>
										</label>									
											<label> <input disabled="disabled" id="poodle" value="poodle"
											type="checkbox" class="ace"> <span class="lbl">
												 Poodle检测</span>
										</label>
								 	</div>
								</div><div class="form-group">
									<label class="col-sm-2 control-label"> <span
										class="require_text">*</span>状态:
									</label>
									<div class="col-sm-7">  
										<input readonly="true" type="text" id="status"
											class="form-control ng-pristine ng-untouched ng-invalid ng-invalid-required">
									</div>
								</div>

								<h3 class="apply_title"></h3>
								
								<div class="hr hr16 hr-dotted"></div>
								<div class="col-sm-12">
										<div class="tabbable">
											<ul class="nav nav-tabs padding-12 tab-color-blue background-blue" id="myTab4">
												<li class="active">
													<a class="btn-success" id="normal_title"  data-toggle="tab" href="#normal">正常</a>
												</li>

												<li>
													<a class="btn-yellow" id="warning_title"  data-toggle="tab" href="#warning">告警</a>
												</li>

												<li>
													<a class="btn-danger" id="error_title"   data-toggle="tab" href="#error">异常</a>
												</li>
											</ul>

											<div class="tab-content">
												<div id="normal" class="tab-pane in active">
												
												</div>

												<div id="warning" class="tab-pane">
												</div>

												<div id="error" class="tab-pane">
												
												</div>
											</div>
										</div>
									</div>
					

							</div>

							<!-- PAGE CONTENT ENDS -->
						</div>
						<!-- /.col -->

					</div>
					<!-- /row -->

					<!-- PAGE CONTENT ENDS -->
				</div>
				<!-- /.col -->
			</div>
			<!-- /.row -->
		</div>
		<!-- /.page-content -->
	</div>
	<!-- /.main-content -->


	</div>
	<!-- /.main-container-inner -->

	<a href="#" id="btn-scroll-up"
		class="btn-scroll-up btn btn-sm btn-inverse"> <i
		class="icon-double-angle-up icon-only bigger-110"></i>
	</a>
	</div>
	<!-- /.main-container -->

	<!-- basic scripts -->
	<!--[if !IE]> -->

	<script
		src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>

	<!-- <![endif]-->

	<!--[if IE]>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<![endif]-->

	<!--[if !IE]> -->

	<script type="text/javascript">
		window.jQuery
				|| document
						.write("<script src='/static/js/jquery-2.0.3.min.js'>"
								+ "<"+"/script>");
	</script>

	<!-- <![endif]-->

	<!--[if IE]>
<script type="text/javascript">
 window.jQuery || document.write("<script src='/static/js/jquery-1.10.2.min.js'>"+"<"+"/script>");
</script>
<![endif]-->

	<script type="text/javascript">
		if ("ontouchend" in document)
			document
					.write("<script src='/static/js/jquery.mobile.custom.min.js'>"
							+ "<"+"/script>");
	</script>
	<script src="/static/js/bootstrap.min.js"></script>
	<script src="/static/js/typeahead-bs2.min.js"></script>

	<!-- page specific plugin scripts -->

	<script src="/static/js/date-time/bootstrap-datepicker.min.js"></script>
	<script src="/static/js/jqGrid/jquery.jqGrid.min.js"></script>
	<script src="/static/js/jqGrid/i18n/grid.locale-en.js"></script>

	<!-- ace scripts -->

	<script src="/static/js/jquery-ui-1.10.3.custom.min.js"></script>
	<script src="/static/js/jquery.ui.touch-punch.min.js"></script>
	<script src="/static/js/jquery.slimscroll.min.js"></script>
	<script src="/static/js/jquery.easy-pie-chart.min.js"></script>
	<script src="/static/js/jquery.sparkline.min.js"></script>
	<script src="/static/js/flot/jquery.flot.min.js"></script>
	<script src="/static/js/flot/jquery.flot.pie.min.js"></script>
	<script src="/static/js/flot/jquery.flot.resize.min.js"></script>
	<script src="/static/js/jquery.dataTables.min.js"></script>
	<!-- ace scripts -->
	<script src="/static/js/bootbox.min.js"></script>
	<script src="/static/js/ace-elements.min.js"></script>
	<script src="/static/js/ace.min.js"></script>

	<!-- inline scripts related to this page -->
	<script src="/static/js/highcharts.js"></script>
	<script type="text/javascript"> 
	function getchecktable(checkres,type)
	{
		 var chkdata='';
		 for ( var i in checkres) {
				var one = checkres[i];
				if(one['statuslevel']!=type)
					{continue;}
				 chkdata += ' <div ><h4 class="header     green"><i class="icon-globe"></i>IP:';
				 chkdata += one['ip'];
				 chkdata += '</h4><p><table class="table table-striped table-bordered table-hover"><tbody >';

				  chkdata += '<tr ><td class="col-sm-1">上一次检测时间</td><td>';
				  chkdata += '<a>'+one['lastcheckts']+'</a></td> ';
				  
				  chkdata += '<td class="col-sm-1">证书</td><td>';

				  chkdata += '<a href="/project/certdetail?id='+one['certinfo']['id']+'">查看详情</a></td></tr>';
				 
				 

				  chkdata += '<tr ><td class="col-sm-1">证书名称</td><td>';
				  chkdata += '<a>'+one['certinfo']['common_name']+'  ['+(one['hostname_validation']?'匹配]':'不匹配]')+'</a></td>';
				  chkdata += '<td class="col-sm-1">证书签名算法</td><td>';
				  chkdata += '<a>'+one['certinfo']['signature_algorithm']+'</a></td></tr>';
				  
				  
				  chkdata += '<tr ><td class="col-sm-1">签发者</td><td>';
				  chkdata += '<a>'+one['certinfo']['issuer_name']+'</a></td>';
				  chkdata += '<td class="col-sm-1">证书链完整性</td><td>';
				  tt=one['certinfo']['chain_order_valid']?'完整':'不完整'
				  chkdata += '<a>'+tt+'</a></td></tr>';
				  
				  chkdata += '<tr ><td class="col-sm-1">剩余时间</td><td>';
				  chkdata += '<a>'+one['certinfo']['expdate']+'天</a></td>';
				  chkdata += '<td class="col-sm-1">证书信任状态</td><td>';
				  tt=one['certinfo']['trusted']?'可信':'不可信'
				  chkdata += '<a>'+tt+'</a></td></tr>';
				  
				  chkdata += '<tr ><td class="col-sm-1">HeartBleed</td><td>';
				  chkdata += '<a>'+checkinfo[one['heartbleed']]+'</a></td>';
				  chkdata += '<td class="col-sm-1">CCS</td><td>';
				  chkdata += '<a>'+checkinfo[one['ccs']]+'</a></td></tr>';
				  
				  chkdata += '<tr><td class="col-sm-1">HSTS</td><td>';

				  chkdata += '<a>'+checkinfo[one['hsts']]+'</a></td>';
				  chkdata += '<td class="col-sm-1">Poodle</td><td>';
				  chkdata += '<a>'+checkinfo[one['poodle']]+'</a></td></tr>';

									
			      chkdata +='</tbody></table></p></div>';

			}
		 return chkdata;
	}
	
	
	function getprojects()
	{
		jQuery
		.getJSON(
				'/project/getprojectreport?id={{id}}',
				function(result) { 
					
					 $('#name').val(result['data']['name']);
					 $('#domain').val(result['data']['domain']);
					 $('#port').val(result['data']['port']);
					 $('#frequency').val(result['data']['check_frequency']);
					 $('#notify_name').val(result['data']['notify_rule_name']);
					 $('#ccs').attr("checked",result['data']['ccs_check']);
					 $('#hsts').attr("checked",result['data']['hsts_check']);
					 $('#heartbleed').attr("checked",result['data']['heartbleed_check']);
					 $('#poodle').attr("checked",result['data']['poodle_check']);
					 
					 checkres = result['data']['checkres'];

					 
					 var res=['任务加载中','检测中','正常','警告','发生错误','过期']
					 $('#status').val(res[result['data']['status']]+':'+result['data']['statusinfo']);
					 
					 
					 checkinfo=['未检测','正常','存在问题']
					 
					
					 $('#normal').html(getchecktable(checkres,0));
					 $('#warning').html(getchecktable(checkres,1));
					 $('#error').html(getchecktable(checkres,2));
					 $('#normal_title').html('正常'+result['data']['normal']);
					 $('#warning_title').html('警告'+result['data']['warning']);
					 $('#error_title').html('错误'+result['data']['error']);
					
				});

	};
	getprojects();
	</script>
	<div style="display: none">
		<script src='http://v7.cnzz.com/stat.php?id=155540&web_id=155540'
			language='JavaScript' charset='gb2312'></script>
	</div>
</body>
</html>

